package com.wechet.utils;

import com.wechet.VO.ResultVo;
import com.wechet.common.ResultStatus;

/**
 * Created by sc on 2017/9/20.
 */
public class ResultVoUtil {

    public static ResultVo success(Object object){
        ResultVo resultVo = new ResultVo();
        resultVo.setCode(ResultStatus.SUCCESS.getCode());
        resultVo.setMsg(ResultStatus.SUCCESS.getMsg());
        resultVo.setData(object);
        return resultVo;
    }

    public static ResultVo success(){
        return success(null);
    }

    public static ResultVo error(Integer code,String msg){
        ResultVo resultVo = new ResultVo();
        resultVo.setMsg(msg);
        resultVo.setCode(code);
        return resultVo;

    }
}
